package com.Maykk.Demo04;

import java.util.Iterator;
import java.util.LinkedList;

/**
 * @ClassName: Demo07
 * @Description: TODO List 集合的遍历
 * @Author: MaykkStar@163.com
 */
public class Demo07 {
    public static void main(String[] args) {
        LinkedList<String> ll = new LinkedList<>();
        ll.add("JavaSE");
        ll.add("MySQL");
        ll.add("HTML");
        ll.add("CSS");
        ll.add("JavaScript");
        for (int i = 0; i < ll.size(); i++) {
            System.out.println(ll.get(i));
        }
        System.out.println("====================");
        for (String str : ll) {
            System.out.println(str);
        }
        System.out.println("====================");
        Iterator<String> it = ll.iterator();
        while (it.hasNext()){
            System.out.println(it.next());
        }

    }
}
